#include "CentralTabBar.h"
#include "CentralTabWidget.h"
#include "Tabs/CentralTab.h"

#include <QApplication>
#include <QWheelEvent>

void CentralTabWidget::wheelEvent(QWheelEvent *event) {
    QPoint pos = event->position().toPoint();
    CentralTabBar *bar = tabBar();

    QRect rect = bar->rect();
    rect.setWidth(width());
    if (!bar->rect().contains(pos) && rect.contains(pos)) {
        QApplication::sendEvent(bar, event);
    }
    BaseTabWidget::wheelEvent(event);
}
